<!DOCTYPE html>
<!-- saved from url=(0048)http://v3.bootcss.com/examples/navbar-fixed-top/ -->
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="./img/icon.png">

    <title>Fixed Top Navbar Example for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="./css/bootstrap.min.css" rel="stylesheet">
	
	<link href="./css/navbar-fixed-top.css" rel="stylesheet">
	<link href="./css/index.css" rel="stylesheet">
	
    

	<style>
		#account_bind_modal .modal-dialog {
			max-width: 360px;
		}
		#content_left {
			padding-left: 15px;
			padding-right: 15px;
			margin-bottom: 20px;
		}
		@media (max-width: 768px){
			#content_left {
				height: 260px;
			}
			#content_left img {
				float: left;
				margin-right: 15px;
			}
		}
		@media (min-width: 768px) {
			#content_left {
				position: absolute;
				width: 260px;
			}
			#content_right {
				left: 290px;
				margin-left: 260px;
			}
			#base_setting .control-label {
				/*width: 6em;*/
			}
		}
		.user_ach {
			color:black;
			font-size: 16px;
			margin:4px 4px 4px 4px;
			padding: 5px 10px 5px 10px;
			display: block;
			float: left;
			background-color: #DEC;
			border: 1px solid #DEC;
			border-radius: 5px;
			text-decoration: none;
		}
		.user_ach:hover {
			background-color: #FEA;
			border-radius: 5px;
			border: 1px solid #C60;
			text-decoration: none;
			color: darkred;
		}
		.err-msg-label {
			display: none
		}
		.has-error .err-msg-label {
			display: block
		}
	</style>
</head>
<body>
	<?php
		require "header.php";
	?>
	<?php
		require "nav.php";
	?>
	
	<div class="container">
		<div id="content_left">
			<div id="user_avatar" class="#pull-left">
				<img class="img-rounded" height="230px" src="./img/userbiglogo.jpg" width="230px">
				<div>
					<h2 id="user_username">fp</h2>
				</div>
			</div>
		</div>
		<div id="content_right">
			<div class="col-sm-12 col-md-6">
				<div class="panel panel-default">
					<div class="panel-heading">基本设置</div>
					<form class="form-horizontal panel-body" role="form" id="base_setting" method="post" action="/Profile/">
						
						<input type="hidden" name="username" value="fp">
						<div class="form-group">
							<label class="col-sm-3 control-label">用户名</label>
							<div class="col-sm-9">
								<label class="control-label"><?php echo $_SESSION['user']; ?></label>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">E-Mail</label>
							<div class="col-sm-9">
								<input class="form-control" type="text" name="email" value="<?php echo $_SESSION['email']; ?>">
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">账户类型:</label>
							<div class="col-sm-9">
								<?php
									$type = $_SESSION['type'];
									if ($type == 0) {
								?>
								<label type="text" class="form-control" name="nickname" value="">管理员</label>
								<?php
									} else  {
								?>
								<label type="text" class="form-control" name="nickname" value="">普通用户</label>
								<?php
									}
								?>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-3 control-label">学校:</label>
							<div class="col-sm-9">
								<input type="text" class="form-control" name="school" value="南京理工大学">
							</div>
						</div>
						<div class="form-group">
							<div class="control-label col-sm-2">
								<button class="btn btn-default" type="submit">修改</button>
							</div>
						</div>
					</form>
				</div>
				<div class="panel panel-default">
					<div class="panel-heading">
						<h4 class="panel-title">
							<a data-toggle="collapse" href="#collapse_change_pass" class="collapsed">
								修改密码
							</a>
						</h4>
					</div>
					<div class="panel-collapse collapse" id="collapse_change_pass" style="height: 0px;">
						<form class="form-horizontal panel-body" id="form_change_password" method="post" action="/Profile/ChangePassword/" onsubmit="return ajax_change_password()">
							
							<input type="hidden" name="username" value="fp">
							<div class="form-group">
								<label class="col-sm-3 control-label">原始密码</label>
								<div class="col-sm-9">
									<label class="err-msg-label"></label>
									<input class="form-control" type="password" name="old_password">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">新密码</label>
								<div class="col-sm-9">
									<label class="err-msg-label"></label>
									<input class="form-control" type="password" name="new_password">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">重复新密码</label>
								<div class="col-sm-9">
									<label class="err-msg-label"></label>
									<input class="form-control" type="password" name="new_password_rep">
								</div>
							</div>
							<div class="form-group">
								<div class="control-label col-sm-2">
									<span></span>
									<button class="btn btn-default" type="submit">修改密码</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
			<div class="col-sm-12 col-md-6">
			</div>
		</div>
	</div>
	
	<?php
		require "footer.php";
	?>
	<script>
		function pop_Regisger()
		{
			$('#register_modal-dialog').modal('show');
			return false;
		}
		function pop_Login() {
			$('#login_modal-dialog').modal('show');
			return false;
		}
		
		function ajax_post(form,callback) {
			$.post(form.attr('action'),
			form.serialize(), 
			function(data, status) {
				//alert("数据：" + data.status + "\n状态：" + status);
				if (status == "success") {
					callback(data)
				}
			},
			"json");
		}
		
		function ajax_login() {
			var form=$("#modal_login_form")
			form.find('.form-group').removeClass('has-error');
			ajax_post(form, function(rep) {
				//$("#content").val(rep.status);
				if (rep.status == "success") {
					//alert("!!");
					window.location.reload();
				} else {
					for (err in rep.errors) {
						gp = form.find("[name='"+err+"']").parent()
						gp.find("label").text(rep.errors[err][0]);
						gp.addClass('has-error')
					}
				}
			});
			//alert("!");
			return false;
		}
		function ajax_logout()
		{
			$.get(
				'logout.php',
				function(data, status){
					//alert("数据：" + data.status+ "\n状态：" + status);
					window.location.href = "http://localhost/tour/login.php";//window.location.reload();
				},
				"json");
			return false;
		}
	</script>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
	
	<script src="./js/require.js"></script>
    
	<script src="./js/jquery-1.11.0.min.js"></script>
	<!--
    <script src="./js/jquery.min.js"></script>
	-->
	<script src="./js/bootstrap.min.js"></script>
    
</body>
</html>